
var express = require('express');
var router = express.Router();
var sql = require('../sql.js');
router.use('/', function(req, res) {
    var id=req.cookies.id
    var newpath=req.cookies.cover

    console.log(req.cookies)  
    console.log(newpath)
  sql(`update admin set cover="${newpath}" where id="${id}"`, function(qerr,vals,fields){ 
    //do something   
    if (qerr) throw qerr;
        if (vals) {
            return res.json(vals)
        }
});  
});

module.exports = router;
